<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>沂水旅游-美食详情-{$store.food_store_name}</title>
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link rel="stylesheet" href="/static/layuiadmin/layui/css/layui.css">
    <link rel="stylesheet" href="/static/index/css/base.css">
    <link rel="stylesheet" href="/static/index/css/baseDetail.css">
    <link rel="stylesheet" href="/static/index/css/restaurant.css">
</head>
<body>

{include file="public/header" model='restaurant' /}

<div class="searchBox layui-hide-xs">
    <div class="layui-container mbx-top-nav">
        <div class="mianbaoxie-nav">
            <span class="layui-breadcrumb">
              <a href="/">首页</a>
              <a href="{:url('Food/foodList')}">美食列表</a>
              <a><cite>{$store.food_store_name}</cite></a>
            </span>
        </div>

        <div class="weather">
            <iframe name="weather_inc" src="http://i.tianqi.com/index.php?c=code&id=5&py=linyi2" width="200" height="30" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" ></iframe>
        </div>

    </div>
</div>

<div class="tour-detail">
    <div class="layui-container">
        <div class="tour-detail-box tour-detail-top">
            <div class="layui-row">
                <div class="layui-col-md6 layui-col-xs12">
                    <div class="tour-title">
                        <h1>{$store.food_store_name}</h1>
                        {eq name="is_select" value="0"}
                        <span id="toCollect" style="cursor: pointer;"><i class="layui-icon layui-icon-rate" style="font-size: 16px; color: #F2BF56;"></i>收藏</span>
                        {else/}
                        <span>已收藏</span>
                        {/eq}
                    </div>
                    <div class="tour-tags">
                        {foreach $store.food_tag as $k => $v}
                        <span>{$v}</span>
                        {/foreach}
                    </div>
                </div>
            </div>

            <div class="layui-row layui-col-space30">

                <div class="layui-col-md7 layui-col-xs12">
                    <div class="layui-row layui-col-space10">
                        <div class="layui-col-md8  layui-col-xs12">
                            <div class="tour_l_img">
                                {notempty name="foodImg[0]['img_path']"}
                                <img src="{$foodImg[0]['img_path']}" alt="">
                                {/notempty}
                            </div>
                        </div>
                        <div class="layui-col-md4  layui-col-xs12">
                            <div class="layui-row layui-col-space10">
                                <div class="layui-col-md12  layui-col-xs6">
                                    <div class="tour_r_img">
                                        {notempty name="foodImg[1]['img_path']"}
                                        <img src="{$foodImg[1]['img_path']}" alt="">
                                        {/notempty}
                                    </div>
                                </div>
                                <div class="layui-col-md12  layui-col-xs6">
                                    <div class="tour_r_img">
                                        {notempty name="foodImg[2]['img_path']"}
                                        <img src="{$foodImg[2]['img_path']}" alt="">
                                        {/notempty}
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="layui-col-md5  layui-col-xs12">

                    <div class="open-time">
                        <i class="layui-icon layui-icon-log" style="font-size: 18px; color: #20E6BA;"></i>&nbsp;
                        营业时间：<span id="open_time">{$store.food_store_time}</span>
                    </div>
                    <div class="tour-address">
                        <div class="tour-address-l">
                            <i class="layui-icon layui-icon-location" style="font-size: 18px; color: #20E6BA;"></i>
                            景点地址：<span id="tour_address">{$store.food_store_address}</span>
                        </div>
                        <div class="tour-address-r">
                            <a href="#map">[ 查看地图 ]</a>
                        </div>
                    </div>

                    <div class="tour-every-price" style="font-size: 18px;color:#FFAD6D;">
                        <i class="layui-icon layui-icon-fonts-clear" style="font-size: 20px; color:#FFAD6D;"></i>&nbsp;
                        人均￥{$store.food_people_money}
                    </div>
                </div>
            </div>
        </div>
    </div>

    <div class="layui-container ticket-info">
        <div class="tour-detail-box tour-detail-midle">

            <div class="layui-row ticket-t">
                <div class="layui-col-md1">
                    <div class="target-s">美食展示</div>
                </div>
                <div class="layui-col-md1">
                    <a href="#dis"><div class="target-s target-s-no">店铺介绍</div></a>
                </div>
                <div class="layui-col-md1">
                    <a href="#map"><div class="target-s target-s-no">用户评价</div></a>
                </div>
            </div>

            <div class="layui-row ticket-discript">

                <div class="layui-col-md12">
                    <div class="ticket-discript-title">
                        美食展示
                    </div>
                </div>

                <div class="layui-col-md10 layui-col-md-offset1">

                    <div class="ticket-discript-content">

                        <div class="layui-row layui-col-space20">

                            {foreach $food as $ke => $va}

                            <div class="layui-col-md3">

                                <div class="show-food-img">
                                    <img src="{$va.food_cover}" alt="">
                                </div>
                                <div class="show-food-name">
                                   {$va.food_title}
                                </div>

                            </div>

                            {/foreach}
                        </div>

                    </div>

                </div>

            </div>

            <div class="layui-row ticket-discript" id="dis">

                <div class="layui-col-md12">
                    <div class="ticket-discript-title">
                        店铺介绍
                    </div>
                </div>

                <div class="layui-col-md10 layui-col-md-offset1">

                    <div class="ticket-discript-content">
                        {$store.food_store_content}
                    </div>

                </div>

            </div>

            <div class="layui-row ticket-discript" id="map">

                <div class="layui-col-md12">
                    <div class="ticket-discript-title">
                        地图指南
                    </div>
                </div>

                <div class="layui-col-md10 layui-col-md-offset1">

                    <div class="ticket-discript-content" id="map_content" style="width: 100%;height:400px">

                    </div>

                </div>

            </div>

        </div>

    </div>

</div>


{include file="public/footer"  /}

<script type="text/javascript" src="https://webapi.amap.com/maps?v=1.4.15&key=358e193808b3b90caecc22bb5dfd23b8"></script>

<script>
        var element = layui.element;
        var form    = layui.form;

        form.render();
        element.init();

        var map = new AMap.Map('map_content', {
            zoom:11,//级别
            scrollWheel: false,
            center: [{$store.food_store_longitude},{$store.food_store_latitude}],//中心点坐标
        viewMode:'3D'//使用3D视图
    });

        var marker = new AMap.Marker({
            position: new AMap.LngLat({$store.food_store_longitude},{$store.food_store_latitude}),   // 经纬度对象，也可以是经纬度构成的一维数组[116.39, 39.9]
        title: '{$store.food_store_name}'
    });

        map.plugin(["AMap.ControlBar"],function(){
            var controlBar = new AMap.ControlBar({showZoomBar:true})
            map.addControl(controlBar)
        });

        map.add(marker);

        var uid = "{$Think.session.uid}";
        var other_id = "{$store.food_store_id}";
        $('#toCollect').click(function(){

            if (!uid) {
                layer.msg('请先登录',{time:1000});
                return false;
            }

            $.ajax({
                    type: "post",
                    url: "{:url('Collect/addCollection')}",
                    dataType: 'json',
                    data: {user_id:uid,other_id:other_id,type:4},

                    success:function(res){
                        if (res.code == 200) {
                            console.log(res.code);
                            layer.msg(res.msg,{time:1000},function(){
                                $('#toCollect').html('已收藏');
                                $('#toCollect').css('cursor','');
                                $('#toCollect').attr('id','');
                            });
                           

                        }else{
                            layer.msg(res.msg,{time:1000});
                        }

                    }
                });

        });
</script>
</body>
</html>